<?
	header("Content-type: text/html; charset=utf-8");
	$startTime=microtime(true);
	define('ROOT',$_SERVER['DOCUMENT_ROOT']);
	$libsPath=ROOT."/libs";
	$zendPath=$libsPath."/zend";
	$zendControllerPath=$libsPath."/zend/Controller";
	set_include_path(
		PATH_SEPARATOR . $libsPath .
		PATH_SEPARATOR . $zendPath .
		PATH_SEPARATOR . $zendControllerPath
	);
	//echo get_include_path();

	error_reporting(E_ALL|E_STRICT);

	//设定时区
	date_default_timezone_set('Asia/Shanghai');

	//指明引用文件的路径
	set_include_path('.' .
      PATH_SEPARATOR . '../../libs'.
      PATH_SEPARATOR . '../app/models/'.
      PATH_SEPARATOR . get_include_path());
      
	require('zend/Loader/Autoloader.php');
	Zend_Loader_Autoloader::getInstance()->registerNamespace('Zend_');//Zend框架的名字空间
	Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);//能够载入无名子空间的类，比如models目录
	//视图
	$registry = Zend_Registry::getInstance();
	$view = new Zend_View();
	$view->setScriptPath('../app/views/scripts/');//设置模板显示路径
	$registry['view'] = $view;//注册View
	//控制器
	$frontController =Zend_Controller_Front::getInstance();
	$frontController->setParam('useDefaultControllerAlways', true)//否则设置基路径会出错
					->setBaseUrl('/haashing/animation')//设置基本路径
					->setParam('noViewRenderer', true)
					->setParam('noErrorHandler', false)
					->setControllerDirectory(array(
          				"default"=>'../app/controllers'
					))
					->throwExceptions(true)//**记得修改
					->dispatch();

	//
/*	$fc = Zend_Controller_Front::getInstance();
	$fc->setControllerDirectory(array(
          "default"=>'../app/controllers',
	));
	$fc->throwExceptions(true);
	$fc->setParam('noViewRenderer', true);
	$fc->setParam('noErrorHandler', false);
	$fc->dispatch();*/
